@extends('admin.layouts.wap')
@section('title', '订单记录')

@section('content')

<div class="mview-order-content">
    @forelse($miniappOrders as $miniappOrder)
    <div class="mview-order-item" onclick="miniappDetial('{{ $miniappOrder->appid }}','{{ $miniappOrder->disable }}');">
        @if($miniappOrder->service_type == 1)
        <div class="icon">协助</div>
        @elseif($miniappOrder->service_type == 2)
        <div class="icon" style="background-image: linear-gradient(90deg, #ff715c, #fe2b38);color: #FFFFFF;">代备案</div>
        @else
        <div class="icon" style="background-image: linear-gradient(90deg, #999999, #333333);color: #FFFFFF;">自助</div>
        @endif
        <div class="content">
            <h3>{{ $miniappOrder->name }}</h3>
            <div class="info">
                @if($miniappOrder->disable == 1)
                <font class="m-bg-success">未使用</font>
                @else
                <font class="m-bg-danger">已使用</font>
                @endif
                <p>¥{{ $miniappOrder->price }}
                    @if($miniappOrder->corp_type == 1)
                    企业
                    @elseif($miniappOrder->corp_type == 2)
                    个体
                    @else
                    个人
                    @endif

                    {{ $miniappOrder->created_at }}</p>
            </div>
        </div>
        <i class="right iconfont icon-toRight-fill"></i>
    </div>
    @empty
    <div class="mview-order-item">
        <div class="content">
            <h3>订单不存在</h3>
            <h5>当前暂无订单记录!</h5>
        </div>
    </div>
    @endforelse
</div>

<script type="text/javascript" src="/assets/admin/js/dev/template_setting.86512.js?v={{ time() }}"></script>
<script>
    function miniappDetial(appid,disable){
        if (disable == 1) {
            mviewToastr("warning","当前订单未使用,不支持查看详情！");
        } else {
            window.location.href = "/admin/miniapps/miniapp_detial/"+appid;
        }
    }
</script>
@endsection
